

clear
set more 1
set type double

***************************************
*Notes
********************************************
*1. IV regs
*4 sets of instruments
*i. phi, emp, iota (all)
*ii. emp, iota (all without phi)
*iii. iota (sticky price only)
*iv. phi, emp (flexible price only)


*1. IV regs
*******************************

*i all instruments
********************************

forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: ivreghdfe dq (duv_k = dxE_phi dxD_phi dxD_lnmemp dxE_lnmemp dxE_share_other dxD_share_usd), cluster(cy) absorb(cpy vat)
}


esttab using "../results/dynamic/dynamicQ_cpy_IV1_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	


*ii. without empl
********************************

forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: ivreghdfe dq (duv_k = dxE_phi dxD_phi dxE_share_other dxD_share_usd), cluster(cy) absorb(cpy vat)
}


esttab using "../results/dynamic/dynamicQ_cpy_IV2_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	

*iii. sticky price instruments
**********************************
forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: ivreghdfe dq (duv_k =  dxE_share_other dxD_share_usd), cluster(cy) absorb(cpy vat)

}

esttab using "../results/dynamic/dynamicQ_cpy_IV3_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	


*************************************
*iv. flexible price instruments

forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: ivreghdfe dq (duv_k = dxE_phi dxD_phi dxD_lnmemp dxE_lnmemp), cluster(cy) absorb(cpy vat)
}


esttab using "../results/dynamic/dynamicQ_cpy_IV4_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	

**********************************************************


****************************************************************
*2. FIRST STAGE
**************************************************************

*i all instruments
********************************
forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: reghdfe duv_k dxE_phi dxD_phi dxD_lnmemp dxE_lnmemp dxE_share_other dxD_share_usd, cluster(cy) absorb(cpy vat)
}


esttab using "../results/dynamic/dynamicQ_cpy_IV1_fs_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	


*ii. without empl
********************************

forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: reghdfe duv_k dxE_phi dxD_phi dxE_share_other dxD_share_usd, cluster(cy) absorb(cpy vat)
}


esttab using "../results/dynamic/dynamicQ_cpy_IV2_fs_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	

*iii. sticky price instruments
**********************************
forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: reghdfe duv_k dxE_share_other dxD_share_usd, cluster(cy) absorb(cpy vat)
}

esttab using "../results/dynamic/dynamicQ_cpy_IV3_fs_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	


*************************************
*iv. flexible price instruments

forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: reghdfe duv_k dxE_phi dxD_phi dxD_lnmemp dxE_lnmemp, cluster(cy) absorb(cpy vat)
}

esttab using "../results/dynamic/dynamicQ_cpy_IV4_fs_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	


***********************************************************
*3.REDUCED FORM
************************************************************
*i all instruments
********************************

forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: reghdfe dq dxE_phi dxD_phi dxD_lnmemp dxE_lnmemp dxE_share_other dxD_share_usd, cluster(cy) absorb(cpy vat)
}

esttab using "../results/dynamic/dynamicQ_cpy_IV1_rf_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	


*ii. without empl
********************************

forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: reghdfe dq dxE_phi dxD_phi dxE_share_other dxD_share_usd, cluster(cy) absorb(cpy vat)
}


esttab using "../results/dynamic/dynamicQ_cpy_IV2_rf_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	

*iii. sticky price instruments
**********************************
forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: reghdfe dq dxE_share_other dxD_share_usd, cluster(cy) absorb(cpy vat)
}

esttab using "../results/dynamic/dynamicQ_cpy_IV3_rf_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	


*************************************
*iv. flexible price instruments

forv lag=1/24 {
use temp/temp_erpt_m`lag', clear
drop if dif==1
	eststo: reghdfe dq dxE_phi dxD_phi dxD_lnmemp dxE_lnmemp, cluster(cy) absorb(cpy vat)
}


esttab using "../results/dynamic/dynamicQ_cpy_IV4_rf_nondif.csv", se b(3) se(3) r2 ar2  plain nostar compress replace
eststo clear	


